<template>
	<view class="goods_info">
		<view class="goods_image">
			<image :src="on_saleitem.goodsMainImgUrl">
			</image>
		</view>
		<view class="goods_text">
			<view class="goods_title">
				<view class="goods_name">{{on_saleitem.goodsVarieties}}
				</view>
				<view class="goods_unit_price">{{on_saleitem.goodsPrice}}/斤</view>
			</view>
			<view class="goods_details">
				<view>剩余：{{on_saleitem.residue}}t</view>
				<view>地区：{{on_saleitem.goodsProductionArea}}</view>
				<view>上货日期：{{on_saleitem.goodsCreateTime}}</view>
			</view>
			<button class="publish_button" @click="goto('../../subpages/sends/sends_goods')">
				编辑</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		props: ['on_saleitem'],
		methods: {
			goto(url) {
				let urlstr = url +'?goodsUuid='+this.on_saleitem.goodsUuid
								+'&goodsVarieties='+this.on_saleitem.goodsVarieties
								+'&goodsType='+this.on_saleitem.goodsType
								+'&goodsKilogram='+this.on_saleitem.goodsKilogram
								+'&goodsPrice='+this.on_saleitem.goodsPrice
								+'&remark='+this.on_saleitem.remark
								+'&goodsStatus='+this.on_saleitem.goodsStatus
								+'&goodsNewTime='+this.on_saleitem.goodsNewTime
								+'&goodsMainImgUrl='+this.on_saleitem.goodsMainImgUrl
				uni.navigateTo({
					url: urlstr,
					animationType: 'slide-in-right',
					animationDuration: 1000
				})
			},
		},
		mounted() {
			// console.log(this.on_saleitem)
		}
	}
</script>

<style>
	.goods_info {
		width: 100%;
		height: 280rpx;
		border-bottom: 0.5px solid rgba(128, 128, 128, 1);
		;
		background-color: rgba(255, 255, 255, 1);
		display: flex;
		flex-direction: row;
	}

	.goods_image {
		margin-left: 32rpx;
		margin-top: 50rpx;
		width: 180rpx;
		height: 180rpx;
		border-radius: 5px;
	}

	.goods_image image {
		border-radius: 5px;
		width: 100%;
		height: 100%;
	}

	.goods_text {
		margin-left: 40rpx;
		margin-top: 40rpx;
	}

	.goods_title {
		display: flex;
		flex-direction: row;
	}

	.goods_name {
		width: 270rpx;
		font-size: 34rpx;
		text-overflow: ellipsis;
		overflow: hidden;
		white-space: nowrap;
		color: rgba(112, 112, 112, 1);
	}

	.goods_unit_price {
		margin-left: 55rpx;
		font-size: 26rpx;
		color: rgba(255, 87, 51, 1);
	}

	.goods_details {
		margin-top: 10rpx;
		font-size: 26rpx;
		color: rgba(112, 112, 112, 1);
	}

	.goods_details view {
		width: 270rpx;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.publish_button {
		width: 125rpx;
		height: 50rpx;
		left: 175rpx;
		position: relative;
		line-height: 50rpx;
		font-size: 26rpx;
		color: rgba(255, 255, 255, 1);
		background-color: rgba(255, 119, 51, 1);
		border-radius: 15px;
	}
</style>
